module.exports = function(grunt) {
	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		jst: {
			compile: {
				options: {
					namespace: 'tpl',
					prettify: true,
					processContent: function(src) {
						return src.replace(/(^\s+|\s+$)/gm, '');
					},
					processName: function(filename) {
						return filename.replace(/^assets\/www\/tpl\//, "").replace(/\.htm/, "");
					},
				},
				files: {
					"assets/www/js/app/tpl.js": ["assets/www/tpl/*.htm"]
				}
			}
		},
		watch: {
			files: ["assets/www/tpl/*.htm"],
			tasks: 'jst'
		}
	});

	grunt.loadNpmTasks('grunt-contrib-jst');
	grunt.loadNpmTasks('grunt-contrib-watch');
	grunt.registerTask('default', ['watch']);
};